package o;

import android.text.TextUtils;
import com.huawei.appgallery.downloadengine.api.SessionDownloadTask;
import com.huawei.appgallery.downloadengine.api.SplitTask;
import com.huawei.appgallery.packagemanager.api.bean.ManagerTask;
import com.huawei.hms.support.api.entity.pay.HwPayConstant;

public class eax extends Thread {
    private boolean ˊ;
    private int ˏ;
    private ManagerTask ॱ;

    public eax(ManagerTask managerTask, int i, boolean z) {
        this.ॱ = managerTask;
        this.ˏ = i;
        this.ˊ = z;
    }

    public void run() {
        if (-10005 == this.ˏ) {
            Logger.e("ReportInstallFailedThread", "install list and backlist is execption.cancel the task.do not install.");
        } else {
            cfw.ॱ(ˊ(this.ॱ, this.ˏ));
        }
    }

    private cvt ˊ(ManagerTask managerTask, int i) {
        int i2 = 1;
        cvt o_cfy = new cfy();
        o_cfy.ˎ(managerTask.packageName);
        o_cfy.ˏ(-1);
        o_cfy.ˋ(String.valueOf(i));
        o_cfy.ˋ(managerTask.ʻ ? 0 : 1);
        if (managerTask.ᐝ == 2) {
            i2 = 2;
        }
        o_cfy.ॱ(i2);
        Object obj = managerTask.ॱॱ;
        if (obj instanceof SessionDownloadTask) {
            SessionDownloadTask sessionDownloadTask = (SessionDownloadTask) obj;
            o_cfy.ॱ(sessionDownloadTask.ʾ());
            o_cfy.ᐝ(sessionDownloadTask.ॱͺ());
            o_cfy.ॱˊ(sessionDownloadTask.ॱʼ());
            o_cfy.setServiceType_(sessionDownloadTask.ॱ());
            if (o_cfy.ˋ() <= 0) {
                o_cfy.ˏ(dkb.ˏ(sessionDownloadTask));
            }
            if (!sessionDownloadTask.ꜟ() && TextUtils.isEmpty(o_cfy.ˏ())) {
                o_cfy.ॱ(((SplitTask) sessionDownloadTask.ᐝˊ().get(0)).ॱॱ());
            }
            o_cfy.ॱॱ(sessionDownloadTask.ॱॱ());
            String ˏ = dof.ˏ(sessionDownloadTask.ᐝ(), "source");
            if (ˏ == null) {
                ˏ = "";
            }
            o_cfy.setSource_(ˏ);
            if (sessionDownloadTask.ˌ() == 4) {
                o_cfy.setBlockIfProtocolNotAgreed(false);
            }
            o_cfy.ˊ(sessionDownloadTask.ˋ());
            o_cfy.ˏ(sessionDownloadTask.ॱˎ("familyShare"));
            o_cfy.ˋॱ(sessionDownloadTask.ॱˊ());
            ˏ = sessionDownloadTask.ॱˎ(HwPayConstant.KEY_PRODUCT_NO);
            if (ˏ != null) {
                eed.ˊ(ˏ, managerTask.packageName, i, sessionDownloadTask.ॱ());
            }
        }
        return o_cfy;
    }
}
